home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 2 / Tech Arsenal 2 (Arsenal Computer).iso / clipper / s93bsp.exe / S87 / INVSLCT.PRG < prev    next >
Encoding:
Text File  |  1993-10-26  |  1.9 KB  |  90 lines

  1. function INVOWNGT
  2. *       I N V O W N G T
  3. *       Routine to search out a customer
  4.  
  5. parameters SEEKVAR
  6. private IVFUNC, OLDSCR
  7. private IVFLDS[4], IVHDRS[4]
  8.  
  9. save screen to OLDSCR
  10. select INVOICE
  11.  
  12. IVHDRS[1] = "Invoice"
  13. IVFLDS[1] = "INVNO"
  14. IVHDRS[2] = "Owner name"
  15. IVFLDS[2] = "OWNNAME"
  16. IVHDRS[3] = "Reg. No"
  17. IVFLDS[3] = "REGNO"
  18. IVHDRS[4] = "Date in"
  19. IVFLDS[4] = "DATEIN"
  20. set softseek on
  21. set deleted on
  22. *   Determine which index we're using and set a low limit
  23. if eof() .or. empty(SEEKVAR)
  24.     SEEKVAR = iif(isalpha(alltrim(SEEKVAR)) .or. empty(SEEKVAR),"!","    1")
  25.     seek SEEKVAR
  26. else             && Position in middle of screen - maybe
  27.     KOUNT = 5
  28.     do while  INVOICE->INVNO<>0 .and. KOUNT>0 .and. .not. bof()
  29.         KOUNT = KOUNT - 1
  30.         skip -1
  31.     enddo
  32.     keyboard replicate(chr(24),5-KOUNT)
  33. endif
  34.  
  35. @ 7, 10,20,64 box replicate(chr(177),9)
  36. @ 8,12 clear to 19,62
  37.  
  38. set color to (COLBRIGHT)
  39. do while .not. GETOUT
  40.     do CTPRMT2
  41.     DBEDIT(8,12,19,62,IVFLDS,"IVFUNC",.t.,IVHDRS,chr(196),chr(179))
  42. enddo
  43.  
  44. GETOUT = .f.
  45. restore screen from OLDSCR
  46. return (MINVNO)
  47.  
  48. ***********************************************************************
  49.  
  50. function IVFUNC
  51. parameters MODE, FLD_PTR
  52. private CURREC, CURFLD, MEDSTR
  53. currec = recno()
  54. rowno=row()
  55. colno = col()
  56.  
  57. QBKEY = lastkey()
  58. clear typeahead
  59. do case
  60. case MODE<4
  61.     if INVOICE->INVNO=0
  62.         keyboard chr(24)
  63.     endif
  64.     return 1
  65. case QBKEY=27
  66.     store "" to MOWNNAME
  67.     MINVNO = 0
  68.     GETOUT = .t.
  69.     return 0
  70. case QBKEY=13
  71.     save screen
  72.     CURFLD = IVFLDS[FLD_PTR]
  73.     MEDSTR = INVOICE->&CURFLD
  74.     set color to (COLFLASH)
  75.     @ ROWNO, COLNO say MEDSTR
  76.     if QBYESNO("Select this Invoice? (Y/N)")="Y"
  77.         MINVNO = INVOICE->INVNO
  78.         GETOUT = .t.
  79.         return 0
  80.     endif
  81.     set color to (COLBRIGHT)
  82.     restore screen
  83. otherwise
  84.     clear typeahead
  85.     do CTPRMT2
  86.     return 1
  87. endcase
  88.  
  89. return 0
  90.